<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<title>查看</title>
	<meta charset="utf-8"/>
	<%@ include file="/commons/global.jsp" %>
	<%@ include file="/commons/basejs.jsp" %>
<link rel="stylesheet" href="${ctxPath}/static/editormd/css/editormd.preview.min.css">
<script src="${ctxPath}/static/editormd/examples/js/jquery.min.js"></script>
<script src="${ctxPath}/static/editormd/lib/marked.min.js"></script>
<script src="${ctxPath}/static/editormd/lib/prettify.min.js"></script>
<script src="${ctxPath}/static/editormd/lib/raphael.min.js"></script>
<script src="${ctxPath}/static/editormd/lib/underscore.min.js"></script>
<script src="${ctxPath}/static/editormd/lib/sequence-diagram.min.js"></script>
<script src="${ctxPath}/static/editormd/lib/flowchart.min.js"></script>
<script src="${ctxPath}/static/editormd/lib/jquery.flowchart.min.js"></script>
<script src="${ctxPath}/static/editormd/editormd.js"></script>
<style type="text/css">
	html {
		font-family: sans-serif;
		-webkit-text-size-adjust: 100%;
		-ms-text-size-adjust: 100%;
	}
	body {
		margin: 0;
	}
</style>
<script>
	$(function(){
        //转换开始,第一个参数是上面的div的id
        editormd.markdownToHTML("testEditorMdview", {
            htmlDecode: "style,script,iframe", //可以过滤标签解码
            emoji: true,
            taskList:true,
            tex: true,               // 默认不解析
            flowChart:true,         // 默认不解析
            sequenceDiagram:true,  // 默认不解析
        });
	})
</script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true,border:false" style="overflow:hidden;">
	<div data-options="region:'center',border:false" title=""
		style="overflow-x: hidden; overflow-y: auto; padding: 3px;">
		<table class="grid">
			<tr>
				<td style="width: 100px"><b>标题</b></td>
				<td>${article.title}</td>
			</tr>
			<tr>
				<td style="width: 100px"><b>类型</b></td>
				<td>${article.typeName}</td>
			</tr>
			<tr>
				<td style="width: 100px"><b>标签</b></td>
				<td>${article.tags}</td>
			</tr>
			<tr>
				<td><b>内容</b></td>
				<%--<td>${article.htmlContent}</td>--%>
				<td>
					<div id="testEditorMdview">
						<textarea id="appendTest" style="display:none;">${article.content}</textarea>
					</div>
				</td>
			</tr>
			<tr>
				<td><b>附件</b></td>
				<td>
					<c:forEach var="attach" items="${article.attachs}">
               	<p>${attach.name}
               		<c:if test="${attach.type=='pdf'}">
               			<a style='margin-left:20px;' href='/jsp/pdfjs/web/viewer.html?file=/pdfView/view?name%3d${attach.id}' target='_blank'>在线预览</a>
               		</c:if>
				  <a style='margin-left:20px;' href='javascript:void(0)' onClick='downloadAttach("${attach.id}")'>下载</a>
               	</c:forEach>
				</td>
			</tr>
		</table>
	</div>
</div>
</body>
</html>